
//检查更新函数
function ApplicationUpdateTool(url) {
    mui.plusReady(function () {
        var api_host = plus.storage.getItem('HOST_URL');
        mui.ajax({
            url:api_host+'/api/other/other/checkAppUpdate',
            dataType: 'json',
            timeout:3000,
            type: 'POST',
            headers:{
                'App-Version':plus.storage.getItem("AVCODE"),
            },
            data:{'version_name':plus.os.name},
            success:function (msg) {
                if(msg.code == 1){
                    // console.log(msg.msg);
                    // mui.toast(msg.msg, {duration: '500',type: 'div'});
                }else{
                    mui.openWindow({
                        url: url,
                        createNew: false,
                        extras: {
                            'errorCode': msg.code,
                            'version_name':msg.data.version_name,
                            'update_log':msg.data.update_log,
                            'url':msg.data.url,
                        },
                        show: {
                            autoShow: true,
                            aniShow: 'fade-in',
                            duration: 400
                        },
                        waiting: {
                            autoShow: false,
                        }
                    });
                }
            },
            error:function () {

            }
        })
    });
}
